//
//  SocketManager.h
//  JiuLe
//
//  Created by xcq on 15/12/8.
//  Copyright © 2015年 Fine. All rights reserved.
//

#import <sys/socket.h>
#import <netinet/in.h>
#import <arpa/inet.h>
#import <unistd.h>
#import "AsyncSocket.h"
#import <Foundation/Foundation.h>
typedef NS_ENUM(NSInteger,SocketOffline) {
    SocketOfflineByServer,// 服务器掉线，默认为0
    SocketOfflineByUser,  // 用户主动cut
};

@interface SocketManager : NSObject<AsyncSocketDelegate>

@property (nonatomic, strong) AsyncSocket    *socket;       // socket
@property (nonatomic, copy  ) NSString       *socketHost;   // socket的Host
@property (nonatomic, assign) UInt16         socketPort;    // socket的prot
@property (nonatomic, retain) NSTimer        *connectTimer; // 计时器
 

+ (SocketManager *)sharedInstance;
- (void)cutOffSocket; // 断开socket连接
- (void)socketConnectHost;
- (void)writeAlarmClock:(NSArray *)dates;
- (void)writeThresholdsSetDxl:(int)dxl gxy:(int)gxy xy:(int)xy;
- (void)writeActiveGet;
@end
